//
//  BaseModel.m
//  LuckyRadio
//
//  Created by Mr、J on 15/11/12.
//  Copyright © 2015年 chenjun. All rights reserved.
//

#import "BaseModel.h"

@implementation BaseModel
- (void)dealloc
{
    [_ID release];
    [super dealloc];
}
-(instancetype)initWithDictionary:(NSDictionary *)dictionary
{
    self = [super init];
    if (self) {
        
        [self setValuesForKeysWithDictionary:dictionary];
    }
    return self;
}
+(instancetype)modelWithDictionary:(NSDictionary *)dic
{
    return [[[self alloc]initWithDictionary:dic]autorelease];
}
-(void)setValue:(id)value forUndefinedKey:(nonnull NSString *)key
{
    if ([key isEqualToString:@"id"]) {
        self.ID = [NSString stringWithFormat:@"%@", value];
    }
}

@end
